#!/bin/bash
for IP in $(cat iptests.txt)
do
    ping -c 1 -W 1 $IP &> /dev/null
    if [ $? -eq 0 ]
    then
        echo "Host $IP is On-line."
    else
        echo "Host $IP is Off-line."
    fi
done
